// Rectangle.java
// by Alexandre Martins, 2013
// MAC 5857 - Prof. Leonidas

package example.ilm.model;

import java.awt.geom.Point2D;
import java.awt.geom.Point2D.Double;

public class Rectangle extends Polygon {

    public Rectangle() {
        super("rectangle");
        vertices.add(new Point2D.Double(-100, 50));
        vertices.add(new Point2D.Double(100, 50));
        vertices.add(new Point2D.Double(100, -50));
        vertices.add(new Point2D.Double(-100, -50));
    }

    public String toString() {
        return "" + 
            "<rectangle>" + 
                "<name>" + getName() + "</name>" + 
                "<description>" + getDescription() + "</description>" + 
                "<position>" +
                    positionToString() +
                "</position>" + 
                "<scale>" + scale + "</scale>" +
                "<angle>" + angle + "</angle>" +
                "<color>" +
                    colorToString() + 
                "</color>" +
                "<vertices>" +
                    verticesToString() +
                "</vertices>" +
            "</rectangle>" +
        "";
    }
}
